package org.budo.cmbc.direct.sdk.entity;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
 * @author lmw
 */
@Getter
@Setter
@ToString
@NoArgsConstructor
public class MEAccountQueryResponse extends AbstractCmbcDirectResponse {
    private static final long serialVersionUID = -3021832469778422828L;

    // 本日可用于提现/支付的金额
    private String availableAmount;

    // 账户异常情况
    private String acctExceptionStatus;

    // 电子账户类型 1-I类户 2-II类户 3-III类户
    private String coreAcType;

    // 绑定卡验证状态 0-已验证，1-未验证
    private String tAcNoState;

    // 电子账户理财份额
    private String rybShare;

    // 是否签约如意宝
    private String isSignFund;

    // 账户状态
    private String acState;

    public MEAccountQueryResponse(String channelJnlNo, String responseJson) {
        super(channelJnlNo, responseJson);

        JSONObject jsonObject = JSON.parseObject(responseJson);
        this.setAvailableAmount(jsonObject.getString("AvailableAmount"));
        this.setAcctExceptionStatus(jsonObject.getString("AcctExceptionStatus"));
        this.setCoreAcType(jsonObject.getString("CoreAcType"));
        this.setTAcNoState(jsonObject.getString("TAcNoState"));
        this.setRybShare(jsonObject.getString("RybShare"));
        this.setIsSignFund(jsonObject.getString("IsSignFund"));
        this.setAcState(jsonObject.getString("AcState"));
    }
}